home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / rpcTypes.h < prev    next >
C/C++ Source or Header  |  1990-12-03  |  3KB  |  94 lines

  1. /*
  2.  * rpcTyes.h --
  3.  *
  4.  *    Declarations of data structures for the rpc module.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/kernel/rpc/RCS/rpcTypes.h,v 1.3 90/12/02 20:31:33 kupfer Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _RPC_TYPES
  19. #define _RPC_TYPES
  20.  
  21. #include <sprite.h>
  22. #ifdef KERNEL
  23. #include <netTypes.h>
  24. #else
  25. #include <kernel/netTypes.h>
  26. #endif /* KERNEL */
  27.  
  28. /*
  29.  * This data structure is here due to conflicts between internal and
  30.  * exported header files.
  31.  */
  32. /*
  33.  * An RPC message is composed of three parts:  the RPC control information,
  34.  * the first data area, ``parameters'', and the second data area, ``data''.
  35.  * A set of three buffer scatter/gather elements is used to specify
  36.  * a complete message. A fourth part of the message is the transport
  37.  * protocol header buffer that proceed any message.
  38.  */
  39. typedef struct RpcBufferSet {
  40.     Net_ScatterGather   protoHdrBuffer;
  41.     Net_ScatterGather   rpcHdrBuffer;
  42.     Net_ScatterGather   paramBuffer;
  43.     Net_ScatterGather   dataBuffer;
  44. } RpcBufferSet;
  45.  
  46. /*
  47.  * The form in which the user expects the server tracing info.
  48.  */
  49. typedef struct  RpcServerUserStateInfo {
  50.     int         index;
  51.     int         clientID;
  52.     int         channel;
  53.     int         state;
  54.     int         num;
  55.     Time        time;
  56. } RpcServerUserStateInfo;
  57.  
  58. /*
  59.  * A client stub procedure has to set up 2 sets of 2 storage areas for an
  60.  * RPC.  The first pair of storage areas is for the request, or input,
  61.  * parameters of the service procedure.  The second pair is for the reply,
  62.  * or return, parameters of the service procedure.  Both the request and
  63.  * the reply have a "data" area and a "parameter" area.  The general
  64.  * convention is that the parameter area is meant for flags, tokens, and
  65.  * other small control information.  The data area is for larger chunks of
  66.  * data like pathnames or fileblocks. Either, or both, of the areas can
  67.  * be empty by setting the address to NIL and the size to zero.
  68.  *
  69.  * The function of a client stub is to arrange its input parameters into
  70.  * two buffers for the two parts of the request.  Also, it must set up the
  71.  * buffer space for the two parts of the reply.  The RPC system will copy
  72.  * the reply data and parameters into these areas, and the stub can access
  73.  * them after Rpc_Call returns.
  74.  */
  75.  
  76. typedef struct Rpc_Storage {
  77.     /*
  78.      * Two areas for data sent to the server.
  79.      */
  80.     Address    requestParamPtr;
  81.     int        requestParamSize;
  82.     Address    requestDataPtr;
  83.     int        requestDataSize;
  84.     /*
  85.      * Two areas for data returned from the server.
  86.      */
  87.     Address    replyParamPtr;
  88.     int        replyParamSize;
  89.     Address    replyDataPtr;
  90.     int        replyDataSize;
  91. } Rpc_Storage;
  92.  
  93. #endif /* _RPC_TYPES */
  94.